<script setup>

//pending(进行中)状态
/*let promise = new Promise((resolve , reject) => {
  console.log("创建promise 对象");

})
console.log("创建promise后");
//此时promise为pending(进行中)状态
console.log(promise);*/
// fulfilled(成功)状态
/*let promise = new Promise((resolve , reject) => {
  console.log("创建promise 对象");
resolve("promise resolve");//设置成功状态信息fulfilled

})
console.log("创建promise后");
//此时promise为fulfilled(成功)状态
console.log(promise);*/
// rejected(失败)状态
/*let promise = new Promise((resolve , reject) => {
  console.log("创建promise 对象");
  reject("promise resolve");//设置失败状态信息rejected

})
console.log("创建promise后");
//此时promise为rejected(失败)状态
console.log(promise);*/

let promise = new Promise((resolve, reject) => {
  console.log("创建promise 对象");
  reject("promise resolve");//设置失败状态信息rejected
  resolve("promise resolve");//设置成功状态信息fulfilled

})
console.log("创建promise后");
//此时promise为rejected(失败)状态 ，
// promise状态一旦发生改变就固定了 ， 不会再改变
console.log(promise);
</script>

<template>
  <div>
    <h1>Test</h1>
  </div>
</template>

<style scoped>

</style>